from rest_framework import serializers
from app01.models import *


class EnterpriseSerializer(serializers.ModelSerializer):
    class Meta:
        model = Enterprise
        fields = ('id', 'name', 'address', 'type', 'projectId')


class LinkmanSerializer(serializers.ModelSerializer):
    class Meta:
        model = Linkman
        fields = ('id', 'name', 'phoneNumber', 'email', 'type')


class OfficeSerializer(serializers.ModelSerializer):
    class Meta:
        model = Office
        fields = ('id', 'name', 'area', 'researchRoomListId')


class ParticipateSerializer(serializers.ModelSerializer):
    class Meta:
        model = Participate
        fields = ('id', 'projectId', 'researcherId', 'fund', 'startTime', 'workLoad', 'type')


class ResearcherSerializer(serializers.ModelSerializer):
    class Meta:
        model = Researcher
        fields = ('id', 'name', 'sex', 'title', 'age', 'researchDirection', 'researchRoomListId')


class ResearchprojectSerializer(serializers.ModelSerializer):
    class Meta:
        model = Researchproject
        fields = ('id', 'name', 'researchDirection', 'fund', 'startTime', 'endTime', 'leaderId')


class ResearchroomlistSerializer(serializers.ModelSerializer):
    class Meta:
        model = Researchroomlist
        fields = ('id', 'name', 'researchDirection', 'secretaryId')


class ScientificpayoffsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Scientificpayoffs
        fields = ('id', 'name', 'type', 'getTime', 'ranking', 'projectId')


class SecretarySerializer(serializers.ModelSerializer):
    class Meta:
        model = Secretary
        fields = ('id', 'name', 'sex', 'age', 'employmentTime', 'responsibility')


class SubprojectSerializer(serializers.ModelSerializer):
    class Meta:
        model = Subproject
        fields = ('id', 'name', 'fund', 'deadline', 'researchDirection', 'projectId', 'leaderId')


class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'name', 'password', 'root')
